package com.handl.springcloud.service;

import com.handl.springcloud.dto.User;
import org.springframework.web.bind.annotation.*;

/**
 *Created by handl on 2017/11/6.
 *
 * 使用Feign中的消费和生产服务抽象和抽离接口
 *
 * 三种传递数据的注解定义：
 *      1.@RequestParam("name")
 *             http中请求的参数，定义了传递的参数名称
 *      2.@RequestHeader("des")
 *              http中请求头的参数
 *      3.@RequestBody
 *              httpbody的数据，封装成了实体对象
 */
public interface UserService {
    @RequestMapping("requestp")
    String getHttpParam(@RequestParam("name") String name);
    @RequestMapping("requesth")
    String getHttpHeard(@RequestHeader("des") String des);
    @RequestMapping("requestb")
    User getHttpBody(@RequestBody User user);
}
